package happy.learn.lesson;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import happy.learn.lesson.nativelib.NativeClient;

public class MainActivity extends AppCompatActivity {

    private TextView textView;
    private NativeClient client = new NativeClient();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        textView = findViewById(R.id.tv_text);
    }

    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_get_string:
                textView.setText(client.getNativeString());
                break;
            case R.id.btn_get_int:
                textView.setText(String.format("random int %d", client.getRandomNum()));
                break;
        }
    }
}
